<template>
  <div class="evaluate">
    <div class="evaluate_title">
      美食评价
      <span @click="back"></span>
    </div>
    <Evaluate :item2="list"></Evaluate>
    <div class="base">没有更多了~</div>
  </div>
</template>

<script>
import Evaluate from "@/components/Evaluate.vue";
import { getFunc } from "@/http/request.js";

export default {
  components: {
    Evaluate,
  },
  data() {
    return {
      list: [],
    };
  },
  methods: {
    // 回退
    back() {
      this.$router.go(-1);
    },
    async initComment() {
      await getFunc(`/cate/comment/?cate_id=${this.$route.query.cate_id}`).then(
        (data) => {
          if (data.code == 200) {
            // console.log(data);
            this.list = data.result;
          }
        }
      );
    },
  },
  mounted() {
    this.initComment();
  },
};
</script>

<style lang='scss' scoped>
@import "@/static/common/base.scss";
.evaluate {
  padding: $p;
  .evaluate_title {
    text-align: center;
    height: 15vw;
    line-height: 15vw;
    border-bottom: 1px solid #ccc;
    font-size: 5.3333vw;
    position: relative;
    span {
      display: inline-block;
      background-color: pink;
      width: 8vw;
      height: 8vw;
      position: absolute;
      left: 0;
      top: 3.5vw;
      background: url("@/assets/左.png") no-repeat center;
      background-size: contain;
    }
  }
  .base {
    text-align: center;
    font-size: 3.2vw;
    margin-bottom: 15vw;
    margin-top: 5vw;
  }
}
</style>